package com.nervenets.web.controller.handler.user.help;

import com.nervenets.web.controller.handler.Handler;
import com.nervenets.web.controller.handler.common.TokenParams;
import com.nervenets.web.hibernate.domain.setting.Help;

import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;

public class HelpCenterHandler extends Handler<TokenParams> {
    @Override
    public String handle(TokenParams params, HttpServletRequest request) throws Exception {
        String hql = "from Help where hot is true ";
        final List<Help> helps = userDao.getAllObjectsByHql(hql, new ArrayList<>());
        return successMessage(new Model(helps));
    }

    @Override
    public String result() throws Exception {
        return null;
    }

    class Model {
        private List<Help> hots;

        public Model(List<Help> hots) {
            this.hots = hots;
        }
    }
}
